<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- saved from url=(0080)http://www.whizlabs.com/examprep/mod/quiz/review.php?attempt=170359&showall=true -->
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    
<link rel="stylesheet" type="text/css" href="./OCPJP 6 - Exam Simulator  Declaring sucks_files/styles.php">
<link rel="stylesheet" type="text/css" href="./OCPJP 6 - Exam Simulator  Declaring sucks_files/styles(1).php">

<!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="http://www.whizlabs.com/examprep/theme/standard/styles_ie7.css" />
<![endif]-->
<!--[if IE 6]>
    <link rel="stylesheet" type="text/css" href="http://www.whizlabs.com/examprep/theme/standard/styles_ie6.css" />
<![endif]-->


    <meta name="keywords" content="moodle, OCPJP 6 - Exam Simulator: Declaring sucks ">
    <title>OCPJP 6 - Exam Simulator: Declaring sucks</title>
    <link rel="shortcut icon" href="http://www.whizlabs.com/examprep/theme/ability-to-learn/favicon.ico">
    <!--<style type="text/css">/*<![CDATA[*/ body{behavior:url(http://www.whizlabs.com/examprep/lib/csshover.htc);} /*]]>*/</style>-->

<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/javascript-static.js"></script>
<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/javascript-mod.php"></script>
<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/overlib.js"></script>
<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/overlib_cssstyle.js"></script>
<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cookies.js"></script>
<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/ufo.js"></script>
<script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/dropdown.js"></script>  

<script type="text/javascript" defer="defer">
//<![CDATA[
setTimeout('fix_column_widths()', 20);
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
function openpopup(url,name,options,fullscreen) {
  fullurl = "http://www.whizlabs.com/examprep" + url;
  windowobj = window.open(fullurl,name,options);
  if (fullscreen) {
     windowobj.moveTo(0,0);
     windowobj.resizeTo(screen.availWidth,screen.availHeight);
  }
  windowobj.focus();
  return false;
}

function uncheckall() {
  void(d=document);
  void(el=d.getElementsByTagName('INPUT'));
  for(i=0;i<el.length;i++) {
    void(el[i].checked=0);
  }
}

function checkall() {
  void(d=document);
  void(el=d.getElementsByTagName('INPUT'));
  for(i=0;i<el.length;i++) {
    void(el[i].checked=1);
  }
}

function inserttext(text) {
  text = ' ' + text + ' ';
  if ( opener.document.forms['theform'].message.createTextRange && opener.document.forms['theform'].message.caretPos) {
    var caretPos = opener.document.forms['theform'].message.caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
  } else {
    opener.document.forms['theform'].message.value  += text;
  }
  opener.document.forms['theform'].message.focus();
}

function getElementsByClassName(oElm, strTagName, oClassNames){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	if(typeof oClassNames == "object"){
		for(var i=0; i<oClassNames.length; i++){
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
		}
	}
	else{
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
	}
	var oElement;
	var bMatchesAll;
	for(var j=0; j<arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k<arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}
//]]>
</script>
    
		<style type="text/css">
	<!--
	#main {
		min-height: 500px;
		width: 988px;
		margin: auto;
		background:#fff;
	}
	#header {
		height: 90px;
		width: 988px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/header.gif);
	}
	#navi {
		float: left;
		height: 22px;
		width: 828px;
		padding: 10px 0pt 0pt 20px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-up_02.gif);
	}
	#navi2 {
		height: 32px;
		width: 140px;
		float: left;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/part3left.gif);
		text-align: left;
	}
	#left {
		float: left;
		min-height: 675px;
		width: 263px;
	}
	
	#leftinsertdiv {
		float: left;
		height: 58px;
		width: 263px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-left-down_04.gif);
	}
	
	#left3 {
		float: left;
		height: 617px;
		width: 21px;
		/*background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-up_05.gif);*/
	}
	
	#left4 {
		height: 58px;
		width: 242px;
		float: right;
	}
	#left5 {
		float: right;
		height: 62px;
		width: 242px;
	}
	#left6 {
		float: right;
		min-height: 160px;
		width: 242px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-up_06-19.gif);
	}
	#right {
		float: left;
		min-height: 601px;
		width: 725px;
		background:#fff;
	}
	#leftfooter {
		float: left;
		height: 159px;
		width: 263px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/footerdiv.gif);
		background-repeat:no-repeat;
	}
	#rightfooter {
		float: left;
		height: 50px;
		width: 725px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-up_10-53.gif);
		background-position:left bottom;
		background-repeat:no-repeat;
		padding-top:90px;
		background-color:#fff;
	}
	#rightfooter2 {
		float: left;
		height: 19px;
		width: 725px;
		background-image: url(http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-up_54.gif);
	}
	-->
	</style>
	
<link href="./OCPJP 6 - Exam Simulator  Declaring sucks_files/css.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>

<script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/document_iterator.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/find_proxy.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/get_html_text.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/global_constants.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/name_injection_builder.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/number_injection_builder.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/string_finder.js"></script><script src="chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/change_sink.js"></script><meta name="document_iterator.js"><meta name="find_proxy.js"><meta name="get_html_text.js"><meta name="global_constants.js"><meta name="name_injection_builder.js"><meta name="number_injection_builder.js"><meta name="string_finder.js"><meta name="change_sink.js"><style charset="utf-8" type="text/css" id="">SPAN.skype_pnh_container SPAN.skype_pnh_mark{  display:none !important;}@media screen{SPAN.skype_pnh_print_container_1323210120{  display:none !important;}SPAN.skype_pnh_container, SPAN.skype_pnh_container *{background-attachment: scroll !important;background-color: transparent !important;background-image: none !important;background-position: 0px 0px ! important;background-repeat: no-repeat !important;border: 0px none !important;border-color: #000000 !important;border-style: none !important;border-width: 0 !important;border-left: 0 none #000000 !important;border-top: 0 none #000000 !important;border-right: 0 none #000000 !important;border-bottom: 0 none #000000 !important;border-left-color: #000000 !important;border-left-style: none !important;border-left-width: 0 !important;border-top-color: #000000 !important;border-top-style: none !important;border-top-width: 0 !important;border-right-color: #000000 !important;border-right-style: none !important;border-right-width: 0 !important;border-bottom-color: #000000 !important;border-bottom-style: none !important;border-bottom-width: 0 !important;border-collapse: separate !important;bottom: auto !important;clear: none !important;clip: auto !important;cursor: pointer !important;direction: ltr !important;display: inline !important;float: none !important;font-style: normal !important;left: auto !important;letter-spacing: 0 !important;list-style-image: none !important;list-style-position: outside !important;list-style-type: disc !important;overflow: hidden !important;overflow-x: hidden !important;overflow-y: hidden !important;padding: 0px 0px 0px 0px !important;padding-left: 0px !important;padding-top: 0px !important;padding-right: 0px !important;padding-bottom: 0px !important;page-break-after: auto !important;page-break-before: auto !important;page-break-inside: auto !important;position: static !important;right: auto !important;table-layout: auto !important;text-align: left !important;text-decoration: none !important;text-indent: 0px !important;text-transform: none !important;top: auto !important;voice-family: inherit !important;white-space: nowrap !important;word-spacing: normal !important;z-index: 0 !important;  color: #49535A !important;  font-family: Tahoma, Arial, Helvetica, sans-serif !important;  font-size: 11px !important;  font-weight: bold !important;  height: 14px !important;  line-height: 14px !important;  margin-left: 0px !important;  margin-top: 0px !important;  margin-right: 0px !important;  margin-bottom: 0px !important;  vertical-align: baseline !important;  width: auto !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_fax SPAN.skype_pnh_right_span, SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_fax SPAN.skype_pnh_right_span{  background-position: -92px 0px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_free SPAN.skype_pnh_dropart_flag_span{  background-position: 0px 1px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_free SPAN.skype_pnh_textarea_span{  background-position: -90px 0px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_free SPAN.skype_pnh_text_span{  visibility: hidden !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_free SPAN.skype_pnh_dropart_flag_span{  background-position: 0px 1px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_free SPAN.skype_pnh_textarea_span{  background-position: -160px 0px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_free SPAN.skype_pnh_text_span{  background-position: -160px 0px !important;  color: #FFFFFF !important;}SPAN.skype_pnh_container SPAN.skype_pnh_left_span{  background-position: 0px 0px !important;  width: 6px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_dropart_span{  background-position: -11px 0px !important;  width: 27px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_dropart_wo_arrow_span{  background-position: -130px 0px !important;  width: 18px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_dropart_flag_span{  background-position: 1px 1px !important;  width: 18px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_textarea_span{  background-position: -125px 0px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_text_span{  padding-left: 5px !important;  background-position: -125px 0px !important;}SPAN.skype_pnh_container SPAN.skype_pnh_right_span{  background-position: -62px 0px !important;  width: 15px !important;}}@media print{SPAN.skype_pnh_print_container_1323210120{}SPAN.skype_pnh_container{    display:none !important;}}@media screen{SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_common *{  background-image:url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/numbers_common_inactive_icon_set.gif') !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_common *{  background-image:url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/numbers_common_active_icon_set.gif') !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_fax *{  background-image:url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/numbers_common_inactive_icon_set.gif') !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_fax *{  background-image:url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/numbers_common_active_icon_set.gif') !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_inactive_free *{  background-image:url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/numbers_free_icon_set.gif') !important;}SPAN.skype_pnh_container SPAN.skype_pnh_highlighting_active_free *{  background-image:url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/numbers_free_icon_set.gif') !important;}SPAN.skype_pnh_container SPAN.skype_pnh_dropart_flag_span{  background-image: url('chrome-extension://lifbcibllhkdhoafpjfnlhfpfgnpldfl/flags.gif') !important;}}</style></head>
<!-- WANT URL-->

<body class="mod-quiz course-11 dir-ltr lang-en_utf8" id="mod-quiz-review" onload="MM_preloadImages(&#39;http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-up_07.gif&#39;,&#39;http://www.whizlabs.com/examprep/theme/ability-to-learn/images/psd-over_05.gif&#39;);">


<div id="main">
  <div id="header"><br>
    <p class="headertxt">Call Us at <span class="skype_pnh_print_container_1323210120">+1-818-575-6625</span><span class="skype_pnh_container" dir="ltr" tabindex="-1"><span class="skype_pnh_mark"> begin_of_the_skype_highlighting</span>&nbsp;<span class="skype_pnh_highlighting_inactive_common" dir="ltr" skypeaction="skype_dropdown" title="Call this phone number in United States of America with Skype: +18185756625"><span class="skype_pnh_left_span" skypeaction="skype_dropdown" title="Skype actions">&nbsp;&nbsp;</span><span class="skype_pnh_dropart_span" skypeaction="skype_dropdown" title="Skype actions"><span class="skype_pnh_dropart_flag_span" skypeaction="skype_dropdown" style="background-position: -5849px 1px !important; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;&nbsp;</span><span class="skype_pnh_textarea_span"><span class="skype_pnh_text_span">+1-818-575-6625</span></span><span class="skype_pnh_right_span">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span>&nbsp;<span class="skype_pnh_mark">end_of_the_skype_highlighting</span></span> | <a href="http://www.whizlabs.com/examprep/login/logout.php?sesskey=wML6iG6GRg">Sign Out</a> | <a href="http://www.whizlabs.com/index.php?option=com_whizmart&view=cart">My Cart</a> | <a href="http://www.whizlabs.com/examprep/user/view.php">Change Password</a></p>
    <p class="txtheader">Welcome <a href="http://www.whizlabs.com/examprep">Flavio&nbsp;Vit !</a></p>
  </div>


  <div id="navi" class="breadcrumb"><h2 class="accesshide ">You are here</h2> <ul>
<li class="first"><a onclick="this.target=&#39;_top&#39;" href="http://www.whizlabs.com/">Home</a></li><li class="first"> <span class="accesshide ">/&nbsp;</span><span class="arrow sep">»</span> <a onclick="this.target=&#39;_top&#39;" href="http://www.whizlabs.com/examprep/">My Account</a></li><li class="first"> <span class="accesshide ">/&nbsp;</span><span class="arrow sep">»</span> <a onclick="this.target=&#39;_top&#39;" href="http://www.whizlabs.com/examprep/course/view.php?id=11">OCPJP 6 - Exam Simulator</a></li><li class="first"> <span class="accesshide ">/&nbsp;</span><span class="arrow sep">»</span> <a onclick="this.target=&#39;_top&#39;" href="http://www.whizlabs.com/examprep/mod/quiz/view.php?id=2553">Declaring sucks</a></li><li class="first"> <span class="accesshide ">/&nbsp;</span><span class="arrow sep">»</span> Review of attempt 1</li></ul>			<div class="navbutton">
				</div>  
  
  <div style="float:right; margin-right:60px;font-size:12px; font-weight:bold; color:#0460AD;">
  	</div>
  </div>

  <div id="navi2">
  <a href="http://www.whizlabs.com/examprep/eddy_report/performance_trak.php?cid=11" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage(&#39;Image1&#39;,&#39;&#39;,&#39;http://www.whizlabs.com/examprep/theme/ability-to-learn/images/layerrollov.gif&#39;,1)"><img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/performace_history.gif" name="Image1" width="125" height="32" border="0" id="Image1"></a></div>
    <!-- END OF HEADER -->
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div><h2 class="main">Declaring sucks</h2><h2 class="main">Review of attempt 1</h2>




<div class="controls">
<div class="singlebutton"><form action="http://www.whizlabs.com/examprep/mod/quiz/view.php" method="get"><div><input type="hidden" name="id" value="2553"><input type="submit" value="Finish review"></div></form></div></div>
<table class="generaltable generalbox quizreviewsummary"><tbody>
<tr><th scope="row" class="cell">Started on</th><td class="cell">Wednesday,  14 December 2011, 07:44 PM</td></tr>
<tr><th scope="row" class="cell">Completed on</th><td class="cell">Wednesday,  14 December 2011, 08:00 PM</td></tr>
<tr><th scope="row" class="cell">Time taken</th><td class="cell">15 mins 30 secs</td></tr>
<tr><th scope="row" class="cell">Grade</th><td class="cell"><b>2</b> out of a maximum of 7 (<b>29</b>%)</td></tr>
</tbody></table>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%201%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5315" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                1      </div>
      </div>
  <div class="content">
    <div class="qtext">
  Given the following interface definition, which of the following class / interface definitions is valid? <br><br>interface I <br>{ <br>
<div style="margin-left: 40px;">void setValue(int val); <br>int getValue(); <br></div>}</div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5315_22610" name="resp5315_" type="radio" value="22610">        </td>
        <td class="c1 text ">
          <label for="resp5315_22610">
            <span class="anun">a<span class="anumsep">.</span></span> class A extends I<br> &nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int value;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void setValue(int val) { value = val; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int getValue() { return value; } <br> &nbsp;&nbsp;&nbsp;&nbsp;}            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5315_22611" name="resp5315_" type="radio" value="22611">        </td>
        <td class="c1 text correct">
          <label for="resp5315_22611">
            <span class="anun">b<span class="anumsep">.</span></span> interface B extends I <br>&nbsp;&nbsp;&nbsp;&nbsp;{ <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;void increment(); <br>&nbsp;&nbsp;&nbsp;&nbsp;}            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_small.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5315_22612" name="resp5315_" checked="checked" type="radio" value="22612">        </td>
        <td class="c1 text ">
          <label for="resp5315_22612">
            <span class="anun">c<span class="anumsep">.</span></span> abstract class C implements I <br>&nbsp;&nbsp;&nbsp;&nbsp;{ <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int getValue(){ return 0; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;abstract void increment();<br>&nbsp;&nbsp;&nbsp;&nbsp;}            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_big.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5315_22613" name="resp5315_" type="radio" value="22613">        </td>
        <td class="c1 text ">
          <label for="resp5315_22613">
            <span class="anun">d<span class="anumsep">.</span></span> interface D implements I <br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void increment(); <br>&nbsp;&nbsp;&nbsp;&nbsp;}            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5315_22614" name="resp5315_" type="radio" value="22614">        </td>
        <td class="c1 text ">
          <label for="resp5315_22614">
            <span class="anun">e<span class="anumsep">.</span></span> class E implements I <br>&nbsp;&nbsp;&nbsp;&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int value; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public void setValue(int val) { value = val; } <br>&nbsp;&nbsp;&nbsp;&nbsp; }            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choice B is the correct answer.<br><br> Classes cannot extend interfaces, they must implement them. So choice A is incorrect. <br><br>Interfaces can extend other interfaces, but cannot implement them. Thus choice B is correct, while choice D is incorrect. <br><br>A class must be declared abstract if it does not define all the methods which are declared in any interfaces implemented by it. <br><br>Choice E is incorrect because the class does not define the getValue() method, but it is not declared abstract. <br><br>Methods declared in interfaces are implicitly public and abstract. Classes that implement these methods must explicitly declare their implementations public. So choice C is also incorrect. <br><br>Want to know more about interfaces? Check out <br><a href="http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html">http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html</a>      </div>
        <div class="grading">
      <div class="correctness  incorrect">Incorrect</div><div class="gradingdetails">Marks for this submission: 0/1.</div>    </div>  </div>
</div>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%202%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5360" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                2      </div>
      </div>
  <div class="content">
    <div class="qtext">
  What is the result of compiling and running the following code fragment? <br><br>String[][][] arr = { { {}, null }, <br>{ { "1", "2" }, <br>{ "1", null, "3" } },<br> {}, { { "1", null } }<br> };<br> System.out.println(arr.length + arr[1][2].length);</div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5360_22812" name="resp5360_" type="radio" value="22812">        </td>
        <td class="c1 text correct">
          <label for="resp5360_22812">
            <span class="anun">a<span class="anumsep">.</span></span> The program will terminate with an ArrayIndexOutOfBoundsException.            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_small.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5360_22813" name="resp5360_" checked="checked" type="radio" value="22813">        </td>
        <td class="c1 text ">
          <label for="resp5360_22813">
            <span class="anun">b<span class="anumsep">.</span></span> The program will terminate with a NullPointerException.            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_big.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5360_22814" name="resp5360_" type="radio" value="22814">        </td>
        <td class="c1 text ">
          <label for="resp5360_22814">
            <span class="anun">c<span class="anumsep">.</span></span> 4 will be written to standard output.            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5360_22815" name="resp5360_" type="radio" value="22815">        </td>
        <td class="c1 text ">
          <label for="resp5360_22815">
            <span class="anun">d<span class="anumsep">.</span></span> 6 will be written to standard output.            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5360_22816" name="resp5360_" type="radio" value="22816">        </td>
        <td class="c1 text ">
          <label for="resp5360_22816">
            <span class="anun">e<span class="anumsep">.</span></span> 7 will be written to standard output.            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choice A is the correct answer.<br><br> The expression arr.length will evaluate to 4. The expression arr[1] will access the element { { "1", "2" }, { "1", null, "3" } }, and arr[1][2] will try to access the third sub-element of this element. This produces an ArrayIndexOutOfBoundsException, since the element has only 2 sub-elements. Since an exception is thrown here, choices C, D and E are incorrect. <br><br>Choice B is incorrect since NullPointerException is not thrown here. <br><a href="http://www.whizlabs.com/examprep/mod/quiz/%20http://java.sun.com/docs/books/tutorial/java/data/multiarrays.html"><br></a>      </div>
        <div class="grading">
      <div class="correctness  incorrect">Incorrect</div><div class="gradingdetails">Marks for this submission: 0/1.</div>    </div>  </div>
</div>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%203%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5517" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                3      </div>
      </div>
  <div class="content">
    <div class="qtext">
  Which of the following methods can be overridden by subclasses? Select two choices.<br></div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose at least one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5517_23564" name="resp5517_23564" type="checkbox" value="23564">        </td>
        <td class="c1 text ">
          <label for="resp5517_23564">
            <span class="anun">a<span class="anumsep">.</span></span> private methods            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5517_23565" name="resp5517_23565" checked="checked" type="checkbox" value="23565">        </td>
        <td class="c1 text ">
          <label for="resp5517_23565">
            <span class="anun">b<span class="anumsep">.</span></span> static methods            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_big.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5517_23566" name="resp5517_23566" type="checkbox" value="23566">        </td>
        <td class="c1 text correct">
          <label for="resp5517_23566">
            <span class="anun">c<span class="anumsep">.</span></span> abstract methods            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_small.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5517_23567" name="resp5517_23567" checked="checked" type="checkbox" value="23567">        </td>
        <td class="c1 text correct">
          <label for="resp5517_23567">
            <span class="anun">d<span class="anumsep">.</span></span> synchronized methods            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_big.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5517_23568" name="resp5517_23568" type="checkbox" value="23568">        </td>
        <td class="c1 text ">
          <label for="resp5517_23568">
            <span class="anun">e<span class="anumsep">.</span></span> final methods            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choices C and D are the correct answers.<br><br> Choice A is incorrect because private methods of the superclass are not visible to the subclasses. So they cannot be overridden. <br><br>Choice B is incorrect because static methods cannot be overridden as they are invoked on the class itself and not on the object. <br><br>Choice E is incorrect as final methods cannot be overridden by subclasses. <br><br>Choices C and D are correct as abstract and synchronized methods can be overridden by subclasses because they have no such restrictions.      </div>
        <div class="grading">
      <div class="correctness  incorrect">Incorrect</div><div class="gradingdetails">Marks for this submission: 0/1.</div>    </div>  </div>
</div>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%204%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5310" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                4      </div>
      </div>
  <div class="content">
    <div class="qtext">
  What will be the result of attempting to compile and run the following program? <br><br>class TestInner <br>{ <br>
<div style="margin-left: 40px;">private static int i=10; <br><br>private static void f()<br>{<br>
  <div style="margin-left: 40px;"> System.out.println(i); <br></div>}<br><br>TestInner() <br>{ <br>
  <div style="margin-left: 40px;">System.out.print("Outer"); <br></div>} <br><br>static class MyInner <br>{ <br>
  <div style="margin-left: 40px;">MyInner()<br>{ <br></div>
  <div style="margin-left: 80px;">System.out.print("Inner"); <br></div>
  <div style="margin-left: 40px;">}<br> void g()<br>{<br></div>
  <div style="margin-left: 80px;"> f(); <br></div>
  <div style="margin-left: 40px;">}<br></div> } <br>public static void main(String[] args) <br>{<br>
  <div style="margin-left: 40px;"> new TestInner.MyInner(); <br></div>} <br></div> }</div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22583" name="resp5310_" type="radio" value="22583">        </td>
        <td class="c1 text ">
          <label for="resp5310_22583">
            <span class="anun">a<span class="anumsep">.</span></span> Prints "OuterInner10"            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22584" name="resp5310_" type="radio" value="22584">        </td>
        <td class="c1 text ">
          <label for="resp5310_22584">
            <span class="anun">b<span class="anumsep">.</span></span> Prints "Outer10"            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22585" name="resp5310_" checked="checked" type="radio" value="22585">        </td>
        <td class="c1 text ">
          <label for="resp5310_22585">
            <span class="anun">c<span class="anumsep">.</span></span> Prints "OuterInner"            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_big.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22586" name="resp5310_" type="radio" value="22586">        </td>
        <td class="c1 text ">
          <label for="resp5310_22586">
            <span class="anun">d<span class="anumsep">.</span></span> Prints "Inner10"            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22587" name="resp5310_" type="radio" value="22587">        </td>
        <td class="c1 text correct">
          <label for="resp5310_22587">
            <span class="anun">e<span class="anumsep">.</span></span> Prints "Inner"            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_small.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22588" name="resp5310_" type="radio" value="22588">        </td>
        <td class="c1 text ">
          <label for="resp5310_22588">
            <span class="anun">f<span class="anumsep">.</span></span> Code does not compile            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5310_22589" name="resp5310_" type="radio" value="22589">        </td>
        <td class="c1 text ">
          <label for="resp5310_22589">
            <span class="anun">g<span class="anumsep">.</span></span> None of the above            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choice E is the correct answer.<br><br> The code compiles and runs without error and prints "Inner". Here, we are not instantiating the outer class, when we say new TestInner().MyInner(). Static nested classes do not need an outer class instance for instantiation. So, the outer class constructor is never invoked here. Also, the method g() and the method f() are not invoked anywhere, so the value of i is not printed. Hence, the output is "Inner" from the inner class constructor. <br><br>Reference: <a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#246026">http://java.sun.com/docs/books/jls/third_edition/html/classes.html#246026</a>      </div>
        <div class="grading">
      <div class="correctness  incorrect">Incorrect</div><div class="gradingdetails">Marks for this submission: 0/1.</div>    </div>  </div>
</div>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%205%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5361" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                5      </div>
      </div>
  <div class="content">
    <div class="qtext">
  What is the result of compiling and running the following code?<br> <br>abstract class AbstractTest<br>{ <br><div style="margin-left: 40px;">static int i;<br> abstract Object test();<br> AbstractTest()<br>{ <br><div style="margin-left: 40px;">System.out.println("A"); <br></div>}<br></div> } <br><br>class Test extends AbstractTest<br>{<br><div style="margin-left: 40px;"> Integer test()<br>{<br><div style="margin-left: 40px;"> return i; <br></div>} <br></div><div style="margin-left: 40px;"><br>public static void main(String[] args)<br>{ <br><div style="margin-left: 40px;">Test t=new Test();<br> System.out.println(t.test());<br></div> } <br></div>}</div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5361_22817" name="resp5361_" type="radio" value="22817">        </td>
        <td class="c1 text ">
          <label for="resp5361_22817">
            <span class="anun">a<span class="anumsep">.</span></span> Compiler error            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5361_22818" name="resp5361_" checked="checked" type="radio" value="22818">        </td>
        <td class="c1 text correct">
          <label for="resp5361_22818">
            <span class="anun">b<span class="anumsep">.</span></span> Prints "A" followed by 0            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_big.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5361_22819" name="resp5361_" type="radio" value="22819">        </td>
        <td class="c1 text ">
          <label for="resp5361_22819">
            <span class="anun">c<span class="anumsep">.</span></span> Prints 0            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5361_22820" name="resp5361_" type="radio" value="22820">        </td>
        <td class="c1 text ">
          <label for="resp5361_22820">
            <span class="anun">d<span class="anumsep">.</span></span> None of these            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choice B is the correct answer.<br><br> The test method in the Test class demonstrates the use of covariant return types i.e., the return type of the overriding method is a subclass of the return type of the overridden method, here Integer is the subclass of Object. When the Test class is instantiated, the default subclass constructor invokes the superclass constructor, so "A" is printed. So choice C is incorrect. <br><br>Static variables are automatically initialized to 0, and may be accessed from non-static methods. So 0 is also printed. <br><br>Since there are no compiler errors or exceptions in this code, choices A and D are also incorrect.      </div>
        <div class="grading">
      <div class="correctness  correct">Correct</div><div class="gradingdetails">Marks for this submission: 1/1.</div>    </div>  </div>
</div>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%206%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5500" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                6      </div>
      </div>
  <div class="content">
    <div class="qtext">
  What will happen when you compile and run the following code? <br><br>public class MyClass <br>{ <br>
<div style="margin-left: 40px;">static int x; <br>public static void main(String[] args) <br>{<br>
  <div style="margin-left: 40px;"> x = 5; <br>MyClass m1 = new MyClass();<br>MyClass m2 = new MyClass(); <br>MyClass m3 = new MyClass(); <br>m1.x = 10; <br>m2.x = 20; <br>m3.x = 30; <br>System.out.println(m1.x); <br>System.out.println(m2.x); <br>System.out.println(m3.x); <br></div>} <br></div>}</div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5500_23483" name="resp5500_" type="radio" value="23483">        </td>
        <td class="c1 text ">
          <label for="resp5500_23483">
            <span class="anun">a<span class="anumsep">.</span></span> Compiler error            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5500_23484" name="resp5500_" type="radio" value="23484">        </td>
        <td class="c1 text ">
          <label for="resp5500_23484">
            <span class="anun">b<span class="anumsep">.</span></span> prints:  <br>&nbsp;&nbsp;&nbsp;&nbsp;10<br>&nbsp;&nbsp;&nbsp;&nbsp;  20<br>&nbsp;&nbsp;&nbsp;&nbsp;  30            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5500_23485" name="resp5500_" checked="checked" type="radio" value="23485">        </td>
        <td class="c1 text correct">
          <label for="resp5500_23485">
            <span class="anun">c<span class="anumsep">.</span></span> prints:  <br>&nbsp;&nbsp;&nbsp;&nbsp;30  <br>&nbsp;&nbsp;&nbsp;&nbsp;30  <br>&nbsp;&nbsp;&nbsp;&nbsp;30            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_big.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5500_23486" name="resp5500_" type="radio" value="23486">        </td>
        <td class="c1 text ">
          <label for="resp5500_23486">
            <span class="anun">d<span class="anumsep">.</span></span> None of these            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choice C is the correct answer. <br><br>The static variables are class variables, i.e. for each instance of a class there is one common variable. Thus, in the above class, there will be only single x shared by three instances m1, m2 and m3. <br><br>The change in x by one instance will be reflected in others. Thus after m3.x = 30, the value of x will be 30 and 30 will be printed three times.      </div>
        <div class="grading">
      <div class="correctness  correct">Correct</div><div class="gradingdetails">Marks for this submission: 1/1.</div>    </div>  </div>
</div>
<div style="float:left"><a href="mailto:support@whizlabs.com?subject=Feedback%20to%20author%20for%20Question%207%20of%20Quiz%20Declaring%20sucks%20(ID:%202113),%20Course%20ID:%2011">Feedback to Author</a></div><div id="q5496" class="que multichoice clearfix">
  <div class="info">
    <span class="no"><span class="accesshide">Question </span></span>
          <div class="grade">
                7      </div>
      </div>
  <div class="content">
    <div class="qtext">
  Given the following enum definition enum Grade{A, B, C, D} Which of the following will compile?</div>


<div class="ablock clearfix">
  <div class="prompt">
    Choose one answer.  </div>

  <table class="answer">
          <tbody><tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5496_23461" name="resp5496_" type="radio" value="23461">        </td>
        <td class="c1 text correct">
          <label for="resp5496_23461">
            <span class="anun">a<span class="anumsep">.</span></span> Grade grade=Grade.A;            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/tick_green_small.gif" alt="Correct" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5496_23462" name="resp5496_" type="radio" value="23462">        </td>
        <td class="c1 text ">
          <label for="resp5496_23462">
            <span class="anun">b<span class="anumsep">.</span></span> Grade g=new Grade(Grade.A);            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5496_23463" name="resp5496_" type="radio" value="23463">        </td>
        <td class="c1 text ">
          <label for="resp5496_23463">
            <span class="anun">c<span class="anumsep">.</span></span> Grade sportsGrade extends Grade { A1, B1}            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5496_23464" name="resp5496_" type="radio" value="23464">        </td>
        <td class="c1 text ">
          <label for="resp5496_23464">
            <span class="anun">d<span class="anumsep">.</span></span> Both A and B            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r0">
        <td class="c0 control">
          <input disabled="disabled" id="resp5496_23465" name="resp5496_" type="radio" value="23465">        </td>
        <td class="c1 text ">
          <label for="resp5496_23465">
            <span class="anun">e<span class="anumsep">.</span></span> Both B and C            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
          <tr class="r1">
        <td class="c0 control">
          <input disabled="disabled" id="resp5496_23466" name="resp5496_" type="radio" value="23466">        </td>
        <td class="c1 text ">
          <label for="resp5496_23466">
            <span class="anun">f<span class="anumsep">.</span></span> Both A and C            <img src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/cross_red_small.gif" alt="Incorrect" class="icon">          </label>
        </td>
        <td class="c0 feedback">
                  </td>
      </tr>
      </tbody></table>
    </div>
      <div class="generalfeedback">
        Choice A is the correct answer. <br><br>Grade.A is a valid constant of type Grade, so it can be assigned to a variable of type Grade. <br><br>Choice B is incorrect because enumerated types cannot be instantiated. <br><br>Choice C is incorrect because enumerated types cannot be extended. <br><br>Choices D, E and F are automatically incorrect. <br><br>References: <br><a href="http://java.sun.com/docs/books/jls/third_edition/html/classes.html#%7C8.9">http://java.sun.com/docs/books/jls/third_edition/html/classes.html#|8.9</a> <br><a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html">http://java.sun.com/j2se/1.5.0/docs/guide/language/enums.html</a>      </div>
        <div class="grading">
      <div class="correctness  incorrect">Incorrect</div><div class="gradingdetails">Marks for this submission: 0/1.</div>    </div>  </div>
</div>

<div class="controls">
<div class="singlebutton"><form action="http://www.whizlabs.com/examprep/mod/quiz/view.php" method="get"><div><input type="hidden" name="id" value="2553"><input type="submit" value="Finish review"></div></form></div></div>
<!--Start - Display Buttons with their course prices in each moodle pages: Devesh M-->
				
		<!--Start - Display Buy Mock Exam Full Version button with price at trial course page only: Devesh M-->
				<!--End - Display Buy Mock Exam Full Version button with price at trial course page only: Devesh M-->
  <div id="leftfooter" style="display: none; "></div><div id="rightfooter" style="display: none; "><p class="footertopma">Thanks Whizlabs for such an excellent product. It really helped me a lot for my achivement. -Nazmul<span class="more"><a href="http://www.whizlabs.com/examprep/mod/quiz/review.php?attempt=170359&showall=true#" class="amore"> more</a></span></p>

  </div>

  <div id="rightfooter2" style="display: none; "><p class="copyright">Whizlabs Copyright (C) 2011. All Rights Reserved.</p></div>
<script language="javascript">
	if(document.getElementById("left-column")) {
	
	}
	else {
		document.getElementById('leftfooter').style.display='none';
		document.getElementById('rightfooter').style.display='none';
		document.getElementById('rightfooter2').style.display='none';
	}
</script>
  <div id="footerbottom">
    
 <center>
	<div style="border:0px solid #FFFFFF; font-size:11px; font-family:Arial, Helvetica, sans-serif; font-weight:bold; color:#000;">
		<br>
		<span><a href="http://www.whizlabs.com/scja/scja.html" title="SCJA Certification" style="text-decoration:none; color:#000;">SCJA Certification</a></span> |
		<span><a href="http://www.whizlabs.com/scjp/scjp.html" title="SCJP Certification" style="text-decoration:none; color:#000;">SCJP Certification</a></span> |
		<span><a href="http://www.whizlabs.com/scwcd/scwcd.html" title="SCWCD Certification" style="text-decoration:none; color:#000;">SCWCD Certification</a></span> |
		<span><a href="http://www.whizlabs.com/scbcd/scbcd.html" title="SCBCD Certification" style="text-decoration:none; color:#000;">SCBCD Certification</a></span> |
		<span><a href="http://www.whizlabs.com/scdjws/scdjws.html" title="SCDJWS Certification" style="text-decoration:none; color:#000;">SCDJWS Certification</a></span> |
		<span><a href="http://www.whizlabs.com/scmad/scmad.html" title="SCMAD Certification" style="text-decoration:none; color:#000;">SCMAD Certification</a></span> |
		<span><a href="http://www.whizlabs.com/scea/scea.html" title="SCEA Certification" style="text-decoration:none; color:#000;">SCEA Certification</a></span>

		<br><br>
		<span><a href="http://www.whizlabs.com/otherpages/legal.html" alt="coming soon" style="text-decoration:none; color:#000;">Legal</a></span> |
		<span><a href="http://www.whizlabs.com/otherpages/policies.html" alt="coming soon" style="text-decoration:none; color:#000;">Policies</a></span> |
		<span><a href="http://www.whizlabs.com/otherpages/copyrights-and-trademarks.html" alt="coming soon" style="text-decoration:none; color:#000;"> Copyrights and Trademarks</a></span>
	</div>
	<br>
</center>
</div>
 </div>

<!--End - Display Buttons with their course prices in each moodle pages: Devesh M-->
<!--Footer links for each moodle pages-->


<!--Google Adwords Code Start: Devesh M-->
	<!--quiz/review.php--> 
	<!-- Google Code for Trial Test Reviewed Conversion Page --> 
	<script type="text/javascript">
	<!--
	var google_conversion_id = 1071861065;
	var google_conversion_language = "en";
	var google_conversion_format = "2";
	var google_conversion_color = "ffffff";
	var google_conversion_label = "YhFjCNjMogEQyZqN_wM"; var google_conversion_value = 0; //--> </script> <script type="text/javascript" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/conversion.js">
	</script><iframe name="google_conversion_frame" width="200" height="26" src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/saved_resource.htm" frameborder="0" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="no">&lt;img height="1" width="1" border="0" src="http://www.googleadservices.com/pagead/conversion/1071861065/?frame=0&amp;random=1323985945063&amp;cv=7&amp;fst=1323985945063&amp;num=1&amp;fmt=2&amp;value=0&amp;label=YhFjCNjMogEQyZqN_wM&amp;bg=ffffff&amp;hl=en&amp;guid=ON&amp;u_h=1080&amp;u_w=1920&amp;u_ah=1080&amp;u_aw=1920&amp;u_cd=32&amp;u_his=19&amp;u_tz=-120&amp;u_java=true&amp;u_nplug=27&amp;u_nmime=117&amp;ref=http%3A//www.whizlabs.com/examprep/mod/quiz/review.php%3Fattempt%3D170359&amp;url=http%3A//www.whizlabs.com/examprep/mod/quiz/review.php%3Fattempt%3D170359%26showall%3Dtrue" /&gt;</iframe>
	<noscript>
	&lt;div style="display:inline;"&gt;
	&lt;img height="1" width="1" style="border-style:none;" alt=""
	src="http://www.googleadservices.com/pagead/conversion/1071861065/?label=YhF
	jCNjMogEQyZqN_wM&amp;amp;guid=ON&amp;amp;script=0"/&gt;
	&lt;/div&gt;
	</noscript>
<!--Google Adwords Code End : Devesh M-->

<!--OnTarget Code Start: Devesh M-->
<script language="JavaScript">
	var s_PageName = "OCPJP 6 - Exam Simulator: Declaring sucks";

			</script>

<!--End of OnTarget Code: Devesh M-->

<!-- Start of Google Analytics Code: Devesh M-->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script src="./OCPJP 6 - Exam Simulator  Declaring sucks_files/ga.js" type="text/javascript"></script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-320509-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<!--End of Google Analytics Code: Devesh M-->



</body><span id="skype_highlighting_settings" display="none" autoextractnumbers="1"></span><object id="skype_plugin_object" location.href="http://www.whizlabs.com/examprep/mod/quiz/review.php?attempt=170359&amp;showall=true" location.hostname="www.whizlabs.com" style="position: absolute; visibility: hidden; left: -100px; top: -100px; " width="0" height="0" type="application/x-vnd.skype.click2call.chrome.5.6.0"></object></html>